POV-Ray : Newsgroups : povray.binaries.images : Up for the challenge? : Re: Up for the challenge? Server Time
7 May 2024 13:21:43 EDT (-0400)
  Re: Up for the challenge?  
From: quickfur
Date: 2 Feb 2007 01:00:01
Message: <web.45c2d02a9125cd5bdd5364bf0@news.povray.org>
"JS" <bos### [at] yahoocouk> wrote:
> I'm so glad you liked my pic that I've uploaded another one and now present
> you all with a challenge. The goal of these pics is to use as MANY objects
> in a scene as possible with as FEW lines of code and with ONLY basic
> objects (i.e. not using an external program to model objects).
>
> If anyone is up to the challenge, I'd be interested in seeing the results
> with information such as how long they took to render.
[...]

I'm pretty sure that eventually somebody is bound to think of
this, but since nobody has spoken up yet, I will. :-) The best
way to create as many objects as possible with as few lines of
code as possible is to use recursive macros (exponential growth).
And highly recursive macros are good for making fractal-like
objects such as trees, so here's one, made from cones and
spheres.

This is rendered with Povray 3.6.1 at a resolution of 600x450.
There are 287361 finite objects in the scene and 2 light sources
(the exact number of objects changes when various parameters
in the scene are tweaked, since I used the rand() function). Max
memory usage was 366MB, which is at the peak of my poor
laptop's capacity. Parsing took 54 seconds, rendering took 4m7s.

I'll post the code if anyone is interested. It's only about 38 lines,
and in interest of conserving space, the only fancy texture is
the sky_sphere and there is actually no ground (the camera
angle is chosen to hide this fact). The code itself can potentially
create much, much, deeper branching, but then my laptop will
run out of memory so the max recursion is 13 levels deep,
branching roughly into 3 (exact number is random) at each
junction. The macro doesn't do any fancy self-intersection
prevention checks, so you might see some self-intersection, but
at least it's not too obvious in the image. :-)


Post a reply to this message


Attachments:
Download 'short01.png' (164 KB)

Preview of image 'short01.png'
short01.png


 

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.